/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trunk.model;

/**
 * Class TestModel
 * 
 * Test unitaire du modele
 * 
 * @author LEFEVRE Michael
 * @author THOUE Jonathan
 */
public class TestModel {
    public static void main(String[] args){
        System.out.println("Test de point");
        Point testPoint0 = new Point();
        System.out.println("New Point : "+(testPoint0 !=null));
        testPoint0.setX(10);
        System.out.println("Point.setX() : "+(testPoint0.getX()==10));
        testPoint0.setY(4);
        System.out.println("Point.setY(); : "+(testPoint0.getY()==4));
        Point testPointSym = testPoint0.createSymetrie();
        System.out.println("Point.createSymetrie() : "+(testPointSym.equals(new Point(-10,-4))));
        Point clonePoint = testPoint0.createClone();
        System.out.println("Point.clone() : "+(clonePoint.equals(testPoint0)));
        System.out.println(" ");
        
        System.out.println("Test de segment");
        Segment testSegment0 = new Segment();
        System.out.println("New Segment : "+(testSegment0 !=null));
        testSegment0.setA(testPoint0);
        System.out.println("Segment.setA : "+(testSegment0.getA()==testPoint0));
        testSegment0.setB(testPointSym);
        System.out.println("Segment.setB : "+(testSegment0.getB()==testPointSym));
        Segment cloneSegment = testSegment0.createClone();
        System.out.println("Segment.createClone() : "+(cloneSegment.equals(testSegment0)));
        Segment symSegment = testSegment0.createSymetrie();
        System.out.println("Segment.createSymetrie() : "+(symSegment.equals(new Segment(testPoint0.createSymetrie(),testPointSym.createSymetrie()))));
        System.out.println(" ");
        
        System.out.println("Test de rectangle");
        Rectangle testRectangle0 = new Rectangle();
        System.out.println("New Rectangle : "+(testRectangle0 !=null));
        testRectangle0.setA(clonePoint);
        System.out.println("Rectangle.setA : "+(testRectangle0.getA()==clonePoint));
        testRectangle0.setB(testPointSym);
        System.out.println("Rectangle.setB : "+(testRectangle0.getB()==testPointSym));
        Rectangle symRectangle = testRectangle0.createSymetrie();
        System.out.println("Rectangle.createSymetrie() : "+(symRectangle.equals(new Rectangle(clonePoint.createSymetrie(),testPointSym.createSymetrie()))));
        Rectangle cloneRectangle = symRectangle.createClone();   
        System.out.println("Rectangle.createClone() : "+(cloneRectangle.equals(symRectangle)));
        System.out.println(" ");
        
        System.out.println("Test de polygone");
        Polygone testPolygone0 = new Polygone();
        System.out.println("New Polygone : "+(testPolygone0 !=null));
        testPolygone0.getListPoint().add(clonePoint);
        //System.out.println("Polygone.add : "+(testPolygone0.getListPoint()==clonePoint));
        System.out.println(" ");
        
        System.out.println("Test de Cercle");
        Cercle testcercle0 = new Cercle();
        System.out.println("New Cercle : "+(testcercle0 !=null));
        testcercle0.setA(testPointSym);
        testcercle0.setRayon(10);
        System.out.println("Cercle.setA : "+(testcercle0.getA()==testPointSym));
        Cercle symCercle = testcercle0.createSymetrie();
        System.out.println("Cercle.createSymetrie() : "+(symCercle.equals(new Cercle(testPointSym.createSymetrie()))));
        Cercle cloneCercle = testcercle0.createClone();
        System.out.println("Cercle.createClone() : "+ (cloneCercle.equals(testcercle0)));
        System.out.println();
        
    }
    
    
    
}
